package org.app.service;
import java.util.List;

import org.app.dao.IContactDAO;
import org.app.domain.Contact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ContactServiceImpl implements IContactService {
	
	@Autowired
    private IContactDAO contactDAO;
 
    @Transactional
    public void addContact(Contact contact) {
        contactDAO.addContact(contact);
    }
 
    @Transactional
    public List<Contact> listContact() {
        return contactDAO.listContact();
    }
 
    @Transactional
    public void removeContact(Long id) {
        contactDAO.removeContact(id);
    }
    @Transactional
    public Contact selectContactById(Long id){
    	return contactDAO.selectContactById(id);
    }
    @Transactional
    public Contact updateContact(Contact contact){
    	return contactDAO.updateContact(contact);
    }
    
}
